package turing.forum.repository.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName(value = "user_comments")
public class Comment {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 评论者的id
     */
    @TableField(value = "user_id")
    private Long from;
    /**
     * 被评论的分享的id
     */
    @TableField(value = "user_share_id")
    private Long to;
    private String content;


    @Version
    private Integer version;
    @TableLogic
    private Integer deleted;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "create_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
